import { createRouter, createWebHistory } from "vue-router";
import Index from "../views/Index.vue"
import Login from "../views/Login.vue"
export default createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: "/",
      redirect: "/index",
    },
    {
      path: "/index",
      name: "Index",
      component: Index,
      redirect: "/index/homes",
      children: [
        {
          path: "class",
          name: "Class",
          component: () => import("../components/class.vue"),
        },
        {
          path: "homes",
          name: "Homes",
          component: () => import("../components/homes.vue"),
        },
        {
          path: "message",
          name: "Message",
          component: () => import("../components/message.vue"),
        },
        {
          path: "release",
          name: "Release",
          component: () => import("../components/release.vue"),
        },
        {
          path: "my",
          name: "My",
          component: () => import("../components/my.vue"),
        },
      ],
    },
    {
      path: "/login",
      name: "Login",
      component: Login,
      redirect: "/login/land",
      children: [
        {
          path: "land",
          name: "Land",
          component: () => import("../components/land.vue"),
        },
        {
          path: "register",
          name: "Register",
          component: () => import("../components/register.vue"),
        },
      ],
    },
  ],
});
